//#ifndef QUADTREE_H
//#define QUADTREE_H
#pragma  once
#include "QNode.h"
//#include "CTreeObject.h"
#include "Collision.h"
#include "Object.h"

#include <map>

class QuadTree
{
private:
	
	QNode *root;

public:

	int max_level;
	list<Object*> obj_list;
	QNode* getRoot() {return root;}
	void setRoot(QNode * obj) {this->root = obj;}

	QuadTree();
	QuadTree(int pos_x, int pos_y, int size, int level);
	~QuadTree();

	//void addAllCTreeObject(string file_name);
	//void build(QNode *n);
	void clip(RECT camara_rect, QNode *p_qnode, list<Object*>* p_obj_list);

	//void deserialize(string file_name);


	void getObjFromCamara(RECT camara_rect, list<Object*>* p_obj_list);
	void getObjFromCamara(QNode *p_qnode, RECT camara_rect, list<Object*>* p_obj_list);


	void getObjList(list<Object*>* p_obj_list);
	void getObjList(QNode *p_qnode, list<Object*>* p_obj_list);
};


//#endif